package com.itqf.controller;

import com.github.pagehelper.PageInfo;
import com.itqf.entity.Product;
import com.itqf.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 作者：杨超波
 * 时间：2019/12/5  15:46
 * 描述：
 */
@Controller
@RequestMapping("product")
public class ProductController {
    @Autowired
    private ProductService productService;
    @RequestMapping("show")
    @ResponseBody
    public PageInfo<Product> show(@RequestParam(defaultValue = "1")Integer pageNum){
        Integer pageSize = 4;
        PageInfo<Product> pageInfo  = productService.show(pageNum,pageSize);
        return pageInfo;
    }
}
